import {Component, OnInit} from '@angular/core';
import {FormControl} from "@angular/forms";

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
  title = 'app works!';

  input1 = new FormControl()
  input2 = new FormControl()

  ngOnInit() {
    this.input1.setValidators(c => {
      console.log('validate ', c)
      return {}
    })
    this.input1.valueChanges.subscribe(console.log)
    this.input2.valueChanges.subscribe(console.log)
  }
}
